package com.fjec.activity.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

@FeignClient(name = "base-serv")
public interface BaseClient {

    /**
     * 获取系统参数
     *
     * @return
     */
    @RequestMapping(method = RequestMethod.GET, value = "/api/setting/get")
    Map<String, Object> getSysSetting();

    /**
     * 上传base64文件
     *
     * @param file     上传文件
     * @param fileName 文件名称
     * @param bizType  业务类型
     * @param bizId    业务Id
     * @param bizCode  业务自定义code
     * @return
     */
    @RequestMapping(method = RequestMethod.POST, value = "/api/annex/base64Upload")
    Map<String, Object> base64Upload(@RequestParam String file,
                                     @RequestParam String fileName,
                                     @RequestParam Integer bizType,
                                     @RequestParam Long bizId,
                                     @RequestParam Integer bizCode
    );

    /**
     * 根据Id获取文件Base64
     *
     * @param id
     * @return
     */
    @RequestMapping(method = RequestMethod.GET, value = "/api/annex/secret/base64/get")
    Map<String, Object> getOSSFileBase64ById(@RequestParam("id") Long id);
}
